/**
 * Created by baijs on 2016/12/12.
 */

var email = require("mailer");

function sendMail(tel, callback) {
    email.send({
            host: "smtp.exmail.qq.com",              // smtp server hostname
            port: "25",                     // smtp server port
            ssl: false,						// for SSL support - REQUIRES NODE v0.3.x OR HIGHER
            domain: "localhost",            // domain used by client to identify itself to server
            to: "baijunsong@subangchina.com",
            from: "mall@subangchina.com",
            subject: "鲸隆洗涤用户在线咨询通知",
            // body: "Hello! This is a test of the node_mailer.",

            template: "server/utils/mailer/templates/template.txt",   // path to template name
            data: {
                "tel": tel
            },

            authentication: "login",        // auth login is supported; anything else is no auth
            username: "mall@subangchina.com",        // username
            password: "Subang111"         // password
        },
        function (err, result) {
            callback(err);
        });
}

module.exports.sendMail = sendMail;
